package one.stand.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import one.stand.aop.ApiController;
import one.stand.model.ResultModel;
import one.stand.request.CompanyModuleConfigRequest;
import one.stand.response.CompanyModuleConfigResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 企业配置信息
 * Created by renz on 2019/8/27 10:59
 */
@RestController
@RequestMapping("crmApi/companyModuleConfig")
@Api(description = "企业模块配置",tags="企业模块配置")
public class CompanyModuleConfigController extends BaseController {

    @PostMapping("findCompanyModuleConfigs")
    @ApiOperation(value = "获取企业模块配置信息")
    @ApiImplicitParams({ @ApiImplicitParam(name = "companyId", value = "企业id", required = true, paramType = "Integer") })
    @ApiController(paramClass = CompanyModuleConfigRequest.class)
    public ResultModel<List<CompanyModuleConfigResponse>> findCompanyModuleConfigs(@RequestAttribute CompanyModuleConfigRequest request) {
        return userFegin.findCompanyModuleConfigs(request);
    }

    @PostMapping("updateCompanyModuleConfig")
    @ApiOperation(value = "修改企业模块配置信息")
    @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "企业模块配置id", required = true, paramType = "Integer"),
                         @ApiImplicitParam(name = "companyId", value = "企业id", required = true, paramType = "Integer"),
                         @ApiImplicitParam(name = "moduleName", value = "企业名称", required = true, paramType = "String") })
    @ApiController(isLogin = true, paramClass = CompanyModuleConfigRequest.class)
    public ResultModel<Boolean> updateCompanyModuleConfig(@RequestAttribute CompanyModuleConfigRequest request) {
        return userFegin.updateCompanyModuleConfig(request);
    }

}
